<template>
  <view class="content">
    <image class="logo" src="/static/logo.png" />
    <view class="text-area">
      <text class="title">{{ title }}</text>
    </view>
    <uni-link href="https://uniapp.dcloud.io/" text="https://uniapp.dcloud.io/"></uni-link>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import * as IndexApi from '@/api/index'

const title = ref('Hello Uni App')

onLoad(() => {
  // GET 请求测试
  IndexApi.requestIndexDataGet({
    name: 'def',
    pageNum: 1,
    pageSize: 10
  })

  // POST 请求测试
  IndexApi.requestIndexDataPost(
    { name: 'hello', pageNum: 1, pageSize: 20 },
    {
      test1: '1',
      test2: '2',
      test3: '3'
    }
  )
})
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .logo {
    height: 200rpx;
    width: 200rpx;
    margin: 200rpx auto 50rpx;
  }

  .text-area {
    display: flex;
    justify-content: center;
  }

  .title {
    font-size: 36rpx;
    color: #8f8f94;
  }
}
</style>
